Telegram Group & Telegram Channel
Что выведет эта программа?

Ответ:
Программа напечатает “num1 == num2”. Если мы сравниваем две ссылки на объекты с помощью ==, значение всегда будет «false». Но в этом примере переменные num1 и num2 автоупаковываются (autoboxing) из-за Integer-кэширования. Вот почему num1 == num2 возвращает значение «true». Не забудьте, что Integer-кэширование актуально только для значений от -128 до 127.



tg-me.com/java_quizes/141
Create:
Last Update:

Что выведет эта программа?

Ответ:
Программа напечатает “num1 == num2”. Если мы сравниваем две ссылки на объекты с помощью ==, значение всегда будет «false». Но в этом примере переменные num1 и num2 автоупаковываются (autoboxing) из-за Integer-кэширования. Вот почему num1 == num2 возвращает значение «true». Не забудьте, что Integer-кэширование актуально только для значений от -128 до 127.

BY Java tests




Share with your friend now:
tg-me.com/java_quizes/141

View MORE
Open in Telegram


Java tests Telegram | DID YOU KNOW?

Date: |

Tata Power whose core business is to generate, transmit and distribute electricity has made no money to investors in the last one decade. That is a big blunder considering it is one of the largest power generation companies in the country. One of the reasons is the company's huge debt levels which stood at ₹43,559 crore at the end of March 2021 compared to the company’s market capitalisation of ₹44,447 crore.

The messaging service and social-media platform owes creditors roughly $700 million by the end of April, according to people briefed on the company’s plans and loan documents viewed by The Wall Street Journal. At the same time, Telegram Group Inc. must cover rising equipment and bandwidth expenses because of its rapid growth, despite going years without attempting to generate revenue.

Java tests from ru


Telegram Java tests
FROM USA